<!doctype html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <title>CSS Cookbook: card component</title>
    <link rel="stylesheet" href="styles.css">
    <style>
        img {
            max-width: 100%;
        }

        .cards {
            max-width: 800px;
            margin: 1em auto;
        }

        .card {
            border: 1px solid #999;
            border-radius: 3px;
        }

        .card img {
            object-fit: cover;
            width: 100%;
            height: 100%;
        }

        .card h2 {
            margin: 0;
            padding: .5rem;
        }

        .card .content {
            padding: .5rem;
        }

        .card footer {
            background-color: #333;
            color: #fff;
            padding: .5rem;
        }
    </style>

    <style class="editable">
        .cards {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
            grid-gap: 20px;
        }

        .card {
            display: grid;
            grid-template-rows: max-content 200px 1fr;
        }

        .card img {
            object-fit: cover;
            width: 100%;
            height: 100%;
        }
    </style>
</head>

<body>
    <section class="preview">
        <div class="cards">
            <article class="card">
                <header>
                    <h2>A short heading</h2>
                </header>

                <img src="balloons.jpg" alt="Hot air balloons">
                <div class="content">
                    <p> The idea of reaching the North Pole by means of balloons appears to have been entertained many
                        years ago. </p>
                </div>

            </article>

            <article class="card">
                <header>
                    <h2>A short heading</h2>
                </header>

                <img src="balloons2.jpg" alt="Hot air balloons">
                <div class="content">
                    <p>Short content.</p>
                </div>
                <footer>I have a footer!</footer>
            </article>

            <article class="card">
                <header>
                    <h2>A longer heading in this card</h2>
                </header>

                <img src="balloons.jpg" alt="Hot air balloons">
                <div class="content">
                    <p>In a curious work, published in Paris in 1863 by Delaville Dedreux, there is a
                        suggestion for reaching the North Pole by an aerostat.</p>
                </div>
                <footer>I have a footer!</footer>
            </article>
            <article class="card">
                <header>
                    <h2>A short heading</h2>
                </header>

                <img src="balloons2.jpg" alt="Hot air balloons">
                <div class="content">
                    <p> The idea of reaching the North Pole by means of balloons appears to have been entertained many
                        years ago. </p>
                </div>

            </article>
        </div>

    </section>

    <textarea class="playable playable-css" style="height: 300px;">
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    grid-gap: 20px;
}

.card {
    display: grid;
    grid-template-rows: max-content 200px 1fr;
}

.card img {
    object-fit: cover;
    width: 100%;
    height: 100%;
}
    </textarea>

    <textarea class="playable playable-html" style="height: 270px;">
<div class="cards">
    <article class="card">
        <header>
            <h2>A short heading</h2>
        </header>    
        <img src="balloons.jpg" alt="Hot air balloons">
        <div class="content">
            <p> The idea of reaching the North Pole by means of balloons appears to have been entertained many years ago. </p>
        </div>
            
    </article>
            
     <article class="card">
        <header>
            <h2>A short heading</h2>
        </header>    
        <img src="balloons2.jpg" alt="Hot air balloons">
        <div class="content">
            <p>Short content.</p>
        </div>
        <footer>I have a footer!</footer>
    </article>
            
    <article class="card">
        <header>
            <h2>A longer heading in this card</h2>
        </header>
        <img src="balloons.jpg" alt="Hot air balloons">
        <div class="content">
            <p>In a curious work, published in Paris in 1863 by Delaville Dedreux, there is a
                suggestion for reaching the North Pole by an aerostat.</p>
        </div>
        <footer>I have a footer!</footer>
    </article>
    <article class="card">
        <header>
            <h2>A short heading</h2>
        </header>
        <img src="balloons2.jpg" alt="Hot air balloons">
        <div class="content">
            <p> The idea of reaching the North Pole by means of balloons appears to have been entertained many
                years ago. </p>
        </div>

    </article>
</div>
            
    </textarea>

    <!-- leave everything below here alone -->
    <div class="playable-buttons">
        <input id="reset" type="button" value="Reset">
    </div>
</body>
<script src="playable.js"></script>

</html>